﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Xml.Linq;
using System.Windows.Resources;
using System.Linq;

namespace TAXILISM.Class
{
    public class CallTaxiColor
    {
        public List<TaxiListCol> taxi_list_col = new List<TaxiListCol>();
        public void feedTaxiCol()
        {
            XElement elm;

            StreamResourceInfo xml = Application.GetResourceStream(new Uri("TaxiCol.xml", UriKind.Relative));
            elm = XElement.Load(xml.Stream);

            var TaxColor = from taxi in elm.Descendants("Taxi")
                             select new TaxiListCol
                             {
                                 Data_id_col = taxi.Element("id").Value,
                                 Data_name_col = taxi.Element("colorName").Value,
                                 Data_col11_col = taxi.Element("color1_1").Value,
                                 Data_col12_col = taxi.Element("color1_2").Value,
                                 Data_col13_col = taxi.Element("color1_3").Value,

                                 Data_col21_col = taxi.Element("color2_1").Value,
                                 Data_col22_col = taxi.Element("color2_2").Value,
                                 Data_col23_col = taxi.Element("color2_3").Value
                             };
            foreach (TaxiListCol rs in TaxColor)
            {
                rs.Data_name_col = "สี" + rs.Data_name_col;
                taxi_list_col.Add(rs);
            }

        }
    }
}
